package com.zzh.bc.base.impl;

import com.zzh.bc.base.BaseDao;
import com.zzh.bc.db.C3p0Utils;

import java.sql.SQLException;

public abstract class BaseDaoImpl<T> implements BaseDao<T> {

    public void beginTransaction() {
        try {
            C3p0Utils.beginTransaction();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }

    public void commitTransaction() {
        try {
            C3p0Utils.commitTransaction();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }

    public void rollbackTransaction() {
        try {
            C3p0Utils.rollbackTransaction();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }
}
